package com.example.cache_module.config;

import jakarta.annotation.PostConstruct;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * @Description
 * @Author lihw
 * @Date 2024/5/7 16:28
 */
@RequiredArgsConstructor
@Configuration
public class CacheConfig {

    final RedisTemplate<Object, Object> redisTemplate;

    @PostConstruct
    public void init() {
        redisTemplate.opsForValue().set("key1", "value1");
    }
}
